package com.itheima.test;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.TreeSet;

public class Zuoye225 {
    public static void main(String[] args) {
        ArrayList<String> al=new ArrayList<String>();
        al.add("abc");
        al.add("tryc");
        al.add("abiuoc");

        ArrayList<Character> al1=new ArrayList<Character>();
        TreeSet<String> ts=new TreeSet<String>();
        for (String s : al) {
            byte[] bytes = s.getBytes();
            for (int i = 0; i < bytes.length; i++) {
                char s1 = (char) bytes[i];
                al1.add(s1);
            }
        }
        for (int i = 0; i < al1.size(); i++) {
            int num=1;
            for (int j = i+1; j < al1.size(); j++) {
                if (al1.get(i).equals(al1.get(j))){
                    al1.remove(al1.get(j));
                    num++;
                    j--;
                }
            }
            String s = al1.get(i) + "=" + num;
            ts.add(s);
           // System.out.println(s);
        }
        for (String t : ts) {
            System.out.println(t);
        }
    }
}
